home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / gdb-4.5 / dist / gdb / Makefile.in < prev    next >
Encoding:
Makefile  |  1992-04-10  |  24.8 KB  |  744 lines

  1. #Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
  2.  
  3. # This file is part of GDB.
  4.  
  5. # This program is free software; you can redistribute it and/or modify
  6. # it under the terms of the GNU General Public License as published by
  7. # the Free Software Foundation; either version 2 of the License, or
  8. # (at your option) any later version.
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. # GNU General Public License for more details.
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software
  15. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16.  
  17. prefix = /usr/local
  18.  
  19. program_prefix =
  20. exec_prefix = $(prefix)
  21. bindir = $(exec_prefix)/bin
  22. libdir = $(exec_prefix)/lib
  23.  
  24. datadir = $(prefix)/lib
  25. mandir = $(prefix)/man
  26. man1dir = $(mandir)/man1
  27. man2dir = $(mandir)/man2
  28. man3dir = $(mandir)/man3
  29. man4dir = $(mandir)/man4
  30. man5dir = $(mandir)/man5
  31. man6dir = $(mandir)/man6
  32. man7dir = $(mandir)/man7
  33. man8dir = $(mandir)/man8
  34. man9dir = $(mandir)/man9
  35. infodir = $(prefix)/info
  36. includedir = $(prefix)/include
  37. docdir = $(datadir)/doc
  38.  
  39. SHELL = /bin/sh
  40.  
  41. INSTALL = install -c
  42. INSTALL_PROGRAM = $(INSTALL)
  43. INSTALL_DATA = $(INSTALL)
  44.  
  45. AR = ar
  46. AR_FLAGS = qv
  47. RANLIB = ranlib
  48.  
  49. # Flags that describe where you can find the termcap library.
  50. # This can be overridden in the host Makefile fragment file.
  51. TERMCAP = -ltermcap
  52.  
  53. # System V: If you compile gdb with a compiler which uses the coff
  54. # encapsulation feature (this is a function of the compiler used, NOT
  55. # of the m-?.h file selected by config.gdb), you must make sure that
  56. # the GNU nm is the one that is used by munch.
  57.  
  58. # If you are compiling with GCC, make sure that either 1) You use the
  59. # -traditional flag, or 2) You have the fixed include files where GCC
  60. # can reach them.  Otherwise the ioctl calls in inflow.c
  61. # will be incorrectly compiled.  The "fixincludes" script in the gcc
  62. # distribution will fix your include files up.
  63. #CC=cc
  64. #CC=gcc -traditional
  65. GCC=gcc
  66.  
  67. # Directory containing source files.  Don't clean up the spacing,
  68. # this exact string is matched for by the "configure" script.
  69. srcdir = .
  70.  
  71. # It is also possible that you will need to add -I/usr/include/sys to the
  72. # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which 
  73. # is where it should be according to Posix).
  74.  
  75. BISON=bison -y
  76. BISONFLAGS=
  77. YACC=$(BISON) $(BISONFLAGS)
  78. # YACC=yacc
  79. MAKE=make
  80.  
  81. # Documentation (gdb.dvi) needs either GNU m4 or SysV m4; 
  82. # Berkeley/Sun don't have quite enough. 
  83. #M4=/usr/5bin/m4
  84. M4=gm4
  85.  
  86. # where to find texinfo; GDB dist should include a recent one
  87. TEXIDIR=${srcdir}/../texinfo/fsf
  88.  
  89. # where to find makeinfo, preferably one designed for texinfo-2
  90. MAKEINFO=makeinfo
  91.  
  92. # Set this up with gcc if you have gnu ld and the loader will print out
  93. # line numbers for undefinded refs.
  94. #CC-LD=gcc -static
  95. CC-LD=${CC}
  96.  
  97. # Where is the "include" directory?  Traditionally ../include or ./include
  98. INCLUDE_DIR =  ${srcdir}/../include
  99. INCLUDE_DEP = $$(INCLUDE_DIR)
  100.  
  101. # Where is the source dir for the MMALLOC library? Traditionally ../mmalloc
  102. # or ./mmalloc  (When we want the binary library built from it, we use
  103. # ${MMALLOC_DIR}${subdir}.)
  104. # Note that mmalloc can still be used on systems without mmap().
  105. # To use your system malloc, comment out the following defines.
  106. MMALLOC_DIR = ${srcdir}/../mmalloc
  107. MMALLOC_DEP = $$(MMALLOC_DIR)
  108. MMALLOC_LIB = ./../mmalloc${subdir}/libmmalloc.a
  109. # To use your system malloc, uncomment MMALLOC_DISABLE.
  110. #MMALLOC_DISABLE = -DNO_MMALLOC
  111. # To use mmalloc but disable corruption checking, uncomment MMALLOC_CHECK
  112. #MMALLOC_CHECK = -DNO_MMALLOC_CHECK
  113. MMALLOC_CFLAGS = ${MMALLOC_CHECK} ${MMALLOC_DISABLE}
  114.  
  115. # Where is the source dir for the BFD library?  Traditionally ../bfd or ./bfd
  116. # (When we want the binary library built from it, we use ${BFD_DIR}${subdir}.)
  117. BFD_DIR =  ${srcdir}/../bfd
  118. BFD_DEP = $$(BFD_DIR)
  119. BFD_LIB = ./../bfd${subdir}/libbfd.a
  120.  
  121. # Where is the source dir for the READLINE library?  Traditionally in .. or .
  122. # (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
  123. READLINE_DIR = ${srcdir}/../readline
  124. READLINE_DEP = $$(READLINE_DIR)
  125. RL_LIB = ./../readline${subdir}/libreadline.a
  126.  
  127. # All the includes used for CFLAGS and for lint.
  128. # -I. for config files.
  129. # -I${srcdir} possibly for regex.h also.
  130. INCLUDE_CFLAGS = -I. -I${srcdir} -I$(INCLUDE_DIR) -I$(READLINE_DIR) -I${srcdir}/vx-share
  131.  
  132. # {X,T}M_CFLAGS, if defined, has system-dependent CFLAGS.
  133. # CFLAGS for GDB
  134. MINUS_G=-g
  135. GLOBAL_CFLAGS = ${MINUS_G} ${TM_CFLAGS} ${XM_CFLAGS}
  136. #PROFILE_CFLAGS = -pg
  137.  
  138. # CFLAGS is the aggregate of several individual *_CFLAGS macros.
  139. # USER_CFLAGS is specifically reserved for setting from the command line
  140. # when running make.  I.E.  "make USER_CFLAGS=-Wmissing-prototypes".
  141. CFLAGS = ${GLOBAL_CFLAGS} ${PROFILE_CFLAGS} ${MMALLOC_CFLAGS} ${INCLUDE_CFLAGS} ${USER_CFLAGS}
  142. # None of the things in CFLAGS will do any harm, and on some systems
  143. #  (e.g. SunOS4) it is important to use the M_CFLAGS.
  144. LDFLAGS = $(CFLAGS)
  145.  
  146. # Where is the "-liberty" library, containing getopt and obstack?
  147. LIBIBERTY_DIR = ${srcdir}/../libiberty
  148. LIBIBERTY = ./../libiberty${subdir}/libiberty.a
  149.  
  150. # The config/mh-* file must define REGEX and REGEX1 on USG machines.
  151. # If your sysyem is missing alloca(), or, more likely, it's there but
  152. # it doesn't work, define ALLOCA & ALLOCA1 too.
  153. # If your system is missing putenv(), add putenv.c to XM_ADD_FILES.
  154.  
  155. # Libraries and corresponding dependencies for compiling gdb.
  156. # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
  157. # TERMCAP comes after readline, since readline depends on it.
  158. CLIBS = ${BFD_LIB}  ${RL_LIB} ${TERMCAP} ${MMALLOC_LIB} ${LIBIBERTY} \
  159.     ${XM_CLIBS} ${TM_CLIBS}
  160. CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${MMALLOC_LIB} ${LIBIBERTY} \
  161.     ${RL_LIB} ${MMALLOC_LIB}
  162.  
  163. ADD_FILES = ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES}
  164. ADD_DEPS = ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES}
  165.  
  166. VERSION = 4.5
  167. DIST=gdb
  168.  
  169. LINT=/usr/5bin/lint
  170. LINTFLAGS= -I${BFD_DIR}
  171.  
  172. # Host and target-dependent makefile fragments come in here.
  173. ####
  174. # End of host and target-dependent makefile fragments
  175.  
  176. # Source files in the main directory.
  177. # Files which are included via a config/* Makefile fragment
  178. # should *not* be specified here; they're in "ALLDEPFILES".
  179. SFILES_MAINDIR = \
  180.      blockframe.c breakpoint.c command.c core.c \
  181.      environ.c eval.c expprint.c findvar.c infcmd.c inflow.c infrun.c \
  182.      main.c printcmd.c gdbtypes.c \
  183.      remote.c source.c stack.c symmisc.c symtab.c symfile.c \
  184.      utils.c valarith.c valops.c valprint.c values.c c-exp.y m2-exp.y \
  185.      signame.c cplus-dem.c mem-break.c target.c inftarg.c \
  186.      dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c \
  187.      ieee-float.c language.c parse.c buildsym.c objfiles.c \
  188.      minsyms.c mipsread.c
  189.  
  190. # Source files in subdirectories (which will be handled separately by
  191. #  'make gdb.tar.Z').
  192. # Files which are included via a config/* Makefile fragment
  193. # should *not* be specified here; they're in "ALLDEPFILES".
  194. SFILES_SUBDIR = \
  195.      ${srcdir}/vx-share/dbgRpcLib.h \
  196.      ${srcdir}/vx-share/ptrace.h \
  197.      ${srcdir}/vx-share/reg.h \
  198.      ${srcdir}/vx-share/vxTypes.h \
  199.      ${srcdir}/vx-share/vxWorks.h \
  200.      ${srcdir}/vx-share/wait.h \
  201.      ${srcdir}/vx-share/xdr_ld.h \
  202.      ${srcdir}/vx-share/xdr_ptrace.h \
  203.      ${srcdir}/vx-share/xdr_rdb.h \
  204.      ${srcdir}/vx-share/xdr_regs.h \
  205.      ${srcdir}/nindy-share/b.out.h \
  206.      ${srcdir}/nindy-share/block_io.h \
  207.      ${srcdir}/nindy-share/coff.h \
  208.      ${srcdir}/nindy-share/demux.h \
  209.      ${srcdir}/nindy-share/env.h \
  210.      ${srcdir}/nindy-share/stop.h \
  211.      ${srcdir}/nindy-share/ttycntl.h
  212.  
  213. # Non-source files in subdirs, that should go into gdb.tar.Z.
  214. NONSRC_SUBDIR = \
  215.      ${srcdir}/nindy-share/Makefile \
  216.      ${srcdir}/nindy-share/VERSION
  217.  
  218. # All source files that go into linking GDB, except config-specified files.
  219. SFILES = $(SFILES_MAINDIR) $(SFILES_SUBDIR)
  220.  
  221. # All source files that lint should look at
  222. LINTFILES = $(SFILES) $(YYFILES) init.c
  223.  
  224. # Any additional files specified on these lines should also be added to
  225. # the OTHERS = definition below, so they go in the tar files.
  226. SFILES_STAND = $(SFILES) standalone.c
  227. SFILES_KGDB  = $(SFILES) stuff.c kdb-start.c
  228.  
  229. # Header files that are not named in config/* Makefile fragments go here.
  230. HFILES=    breakpoint.h buildsym.h call-cmds.h command.h defs.h environ.h \
  231.     expression.h frame.h gdbcmd.h gdbcore.h gdbtypes.h \
  232.     ieee-float.h inferior.h minimon.h objfiles.h partial-stab.h \
  233.     signals.h signame.h symfile.h symtab.h solib.h xcoffsolib.h \
  234.     target.h terminal.h tm-68k.h tm-i960.h tm-sunos.h tm-sysv4.h \
  235.     xm-m68k.h xm-sysv4.h language.h parser-defs.h value.h xm-vax.h
  236.  
  237. REMOTE_EXAMPLES = m68k-stub.c i386-stub.c rem-multi.shar
  238.  
  239. POSSLIBS_MAINDIR = regex.c regex.h alloca.c
  240. POSSLIBS = $(POSSLIBS_MAINDIR)
  241.  
  242. TESTS = testbpt.c testfun.c testrec.c testreg.c testregs.c
  243.  
  244. OTHERS = Makefile.in depend alldeps.mak createtags munch configure.in \
  245.      ChangeLog ChangeLog-9091 ChangeLog-3.x gdb.1 refcard.ps \
  246.      README TODO TAGS WHATS.NEW Projects \
  247.      .gdbinit COPYING $(YYFILES) \
  248.      copying.c Convex.notes copying.awk \
  249.      saber.suppress standalone.c stuff.c kdb-start.c \
  250.      putenv.c
  251.  
  252. # Subdirectories of gdb, which should be included in their entirety in
  253. # gdb-xxx.tar.Z:
  254. TARDIRS = doc # tests
  255.  
  256. # GDB "info" files, which should be included in their entirety
  257. INFOFILES = gdb.info*
  258.  
  259. DEPFILES= ${TDEPFILES} ${XDEPFILES}
  260.  
  261. SOURCES=$(SFILES) $(ALLDEPFILES) $(YYFILES)
  262. TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS} 
  263. TAGFILES_MAINDIR = $(SFILES_MAINDIR) $(ALLDEPFILES_MAINDIR) \
  264.              ${HFILES} ${ALLPARAM} ${POSSLIBS_MAINDIR} 
  265. TARFILES = ${TAGFILES_MAINDIR} ${OTHERS} ${REMOTE_EXAMPLES}
  266.  
  267. OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
  268.     values.o eval.o valops.o valarith.o valprint.o printcmd.o \
  269.     symtab.o symfile.o symmisc.o infcmd.o infrun.o remote.o \
  270.     command.o utils.o expprint.o environ.o version.o gdbtypes.o \
  271.     copying.o $(DEPFILES) signame.o cplus-dem.o mem-break.o target.o \
  272.     inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
  273.     buildsym.o objfiles.o minsyms.o \
  274.     dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o mipsread.o
  275.  
  276. RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
  277.  
  278. TSOBS = core.o inflow.o
  279.  
  280. NTSOBS = standalone.o
  281.  
  282. TSSTART = /lib/crt0.o
  283.  
  284. NTSSTART = kdb-start.o
  285.  
  286. SUBDIRS = doc
  287.  
  288. # For now, shortcut the "configure GDB for fewer languages" stuff.
  289. YYFILES = c-exp.tab.c m2-exp.tab.c
  290. YYOBJ = c-exp.tab.o m2-exp.tab.o
  291.  
  292. # Prevent Sun make from putting in the machine type.  Setting
  293. # TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
  294. .c.o:
  295.     ${CC} -c ${CFLAGS} $<
  296.  
  297. all: gdb
  298.     $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)"
  299. check:
  300. info: force
  301.     $(MAKE) subdir_do DO=info "DODIRS=$(SUBDIRS)" "MAKEINFO=$(MAKEINFO)"
  302. install-info: force
  303.     $(MAKE) subdir_do DO=install-info "DODIRS=$(SUBDIRS)"
  304. clean-info: force
  305.     $(MAKE) subdir_do DO=clean-info "DODIRS=$(SUBDIRS)"
  306.  
  307. gdb.z:gdb.1
  308.     nroff -man $(srcdir)/gdb.1 | col -b > gdb.t 
  309.     pack gdb.t ; rm -f gdb.t
  310.     mv gdb.t.z gdb.z
  311.     
  312. install: gdb 
  313.     $(INSTALL_PROGRAM) gdb $(bindir)/$(program_prefix)gdb
  314.     $(INSTALL_DATA) $(srcdir)/gdb.1 $(man1dir)/$(program_prefix)gdb.1
  315.     $(M_INSTALL)
  316.     $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS)"
  317.  
  318. init.c: $(srcdir)/munch $(OBS) $(TSOBS)
  319.     $(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c
  320.  
  321. gdb: $(OBS) $(TSOBS) ${ADD_DEPS} ${CDEPS} init.o
  322.     ${CC-LD} $(LDFLAGS) -o gdb init.o $(OBS) $(TSOBS) $(ADD_FILES) \
  323.       $(CLIBS) $(LOADLIBES)
  324.  
  325. saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c
  326.     #setopt load_flags $(CFLAGS) -I$(BFD_DIR) -DHOST_SYS=SUN4_SYS
  327.     #load ./init.c $(SFILES)
  328.     #unload ${srcdir}/c-exp.y ${srcdir}/m2-exp.y ${srcdir}/vx-share/*.h
  329.     #unload ${srcdir}/nindy-share/[A-Z]*
  330.     #load c-exp.tab.c m2-exp.tab.c
  331.     #load copying.c version.c
  332.     #load ../libiberty/libiberty.a
  333.     #load ../bfd/libbfd.a
  334.     #load ../readline/libreadline.a
  335.     #load ../mmalloc/libmmalloc.a
  336.     #load -ltermcap 
  337.     #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
  338.     echo "Load .c corresponding to:" $(DEPFILES)
  339.  
  340.  
  341. # This is useful when debugging GDB, because some Unix's don't let you run GDB
  342. # on itself without copying the executable.  So "make gdb1" will make
  343. # gdb and put a copy in gdb1, and you can run it with "gdb gdb1".
  344. # Removing gdb1 before the copy is the right thing if gdb1 is open
  345. # in another process.
  346. gdb1: gdb
  347.     rm -f gdb1
  348.     cp gdb gdb1
  349.  
  350. # This is a remote stub which runs under unix and starts up an
  351. # inferior process.  This is at least useful for debugging GDB's
  352. # remote support.
  353. rapp: $(RAPP_OBS)
  354.     rm -f rapp_init.c
  355.     ${srcdir}/munch ${MUNCH_DEFINE} ${RAPP_OBS} > rapp_init.c
  356.     ${CC-LD} $(LDFLAGS) -o $@ rapp_init.c $(RAPP_OBS)
  357.     
  358. # Support for building Makefile out of configured pieces, automatically
  359. # generated dependencies, etc.  alldeps.mak is a file that contains
  360. # "make" variable definitions for all ALLDEPFILES, ALLDEPFILES_MAINDIR,
  361. # ALLDEPFILES_SUBDIR, ALLPARAM, and ALLCONFIG, all cadged from the current
  362. # contents of the config subdirectory.
  363.  
  364. alldeps.mak: ${srcdir}/config
  365.     rm -f alldeps.mak alldeps.tmp allparam.tmp allconfig.tmp
  366.     for i in `ls -d ${srcdir}/config/*.m[ht]` ; do \
  367.       echo $$i >>allconfig.tmp; \
  368.       awk <$$i ' \
  369.         $$1 == "TDEPFILES=" || $$1 == "XDEPFILES=" { \
  370.           for (i = 2; i <= NF; i++) \
  371.             print $$i >> "alldeps.tmp" ; \
  372.             } \
  373.         $$1 == "TM_FILE=" || $$1 == "XM_FILE=" { \
  374.           print $$2 >> "allparam.tmp" }' ; \
  375.     done
  376.     sort <alldeps.tmp | uniq | \
  377.       sed -e 's/arm-convert.o/arm-convert.s/' \
  378.           -e 's!^Onindy.o!nindy-share/Onindy.c!' \
  379.           -e 's!^nindy.o!nindy-share/nindy.c!' \
  380.           -e 's!ttybreak.o!nindy-share/ttybreak.c!' \
  381.           -e 's!ttyflush.o!nindy-share/ttyflush.c!' \
  382.           -e 's!xdr_ld.o!vx-share/xdr_ld.c!' \
  383.           -e 's!xdr_ptrace.o!vx-share/xdr_ptrace.c!' \
  384.           -e 's!xdr_rdb.o!vx-share/xdr_rdb.c!' \
  385.           -e 's!xdr_regs.o!vx-share/xdr_regs.c!' \
  386.           -e 's/\.o/.c/' \
  387.         >alldeps2.tmp
  388.     echo '# Start of "alldeps.mak" definitions' \
  389.         >>alldeps.mak;
  390.     echo 'ALLDEPFILES = $$(ALLDEPFILES_MAINDIR) $$(ALLDEPFILES_SUBDIR)' \
  391.         >>alldeps.mak;
  392.     grep -v / alldeps2.tmp | \
  393.       awk 'BEGIN {printf "ALLDEPFILES_MAINDIR="} \
  394.         NR == 0 {printf $$0;} \
  395.         NR != 0 {printf "\\\n" $$0} \
  396.         END {printf "\n\n"}' >>alldeps.mak;
  397.     grep / alldeps2.tmp | \
  398.       awk 'BEGIN {printf "ALLDEPFILES_SUBDIR="} \
  399.         NR == 0 {printf $$0;} \
  400.         NR != 0 {printf "\\\n" $$0} \
  401.         END {printf "\n\n"}' >>alldeps.mak;
  402.     sort <allparam.tmp | uniq | awk 'BEGIN {printf "ALLPARAM="} \
  403.         NR == 0 {printf $$0;} \
  404.         NR != 0 {printf "\\\n" $$0} \
  405.         END {printf "\n\n"}' >>alldeps.mak;
  406.     sort <allconfig.tmp | uniq | awk 'BEGIN {printf "ALLCONFIG="} \
  407.         NR == 0 {printf $$0;} \
  408.         NR != 0 {printf "\\\n" $$0} \
  409.         END {printf "\n\n"}' >>alldeps.mak;
  410.     echo '# End of "alldeps.mak" definitions' \
  411.         >>alldeps.mak;
  412.     rm -f alldeps.tmp alldeps2.tmp allparam.tmp allconfig.tmp
  413.  
  414. # The sed script makes everything which depends on {x,t}m.h depend on
  415. # config.status as well, in case someone reconfigures gdb out from
  416. # under an already compiled gdb.
  417. depend: $(SOURCES) Makefile.in
  418.     @echo Ignore errors about non-existent system-supplied include files
  419.     @echo for systems other than the one you are using.
  420.     @echo "If xm.h and tm.h don't exist, the error messages saying so"
  421.     @echo can safely be ignored.
  422.     @echo Also ignore parse errors in valops.c, and any errors in
  423.     @echo arm-convert.s.
  424.     -$(GCC) -MM -nostdinc -I/usr/include $(CFLAGS) -I$(BFD_DIR) \
  425.       `ls $(SOURCES) | grep -v '\.[hy]$$' |sort -u` >depend.tmp
  426. # If running in srcdir, translate "./foo.c" into "$srcdir/foo.c" except
  427. # for xm.h and tm.h.  This allows the same "depend" file to be used
  428. # by the various subdirectories.
  429.     if [ "${srcdir}" = "." ] ; then \
  430.       <depend.tmp sed \
  431.         -e 's; ./xm.h; xm.h;g'  \
  432.         -e 's; ./tm.h; tm.h;g'  \
  433.         -e 's; \./; $${srcdir}/;g'  \
  434.         -e 's; vx-share/; $${srcdir}/vx-share/;g'  \
  435.         -e 's; nindy-share/; $${srcdir}/nindy-share/;g'  \
  436.         >depend.tm2; \
  437.       rm depend.tmp; \
  438.       mv depend.tm2 depend.tmp; \
  439.     fi
  440.     <depend.tmp sed \
  441.       -e 's; [xt]m.h;& config.status;g'  \
  442.       -e 's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g'  \
  443.       -e 's; $(READLINE_DIR)/; $(READLINE_DEP)/;g'  \
  444.       -e 's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g'  \
  445.       -e 's; ./xm.h; xm.h config.status;g'  \
  446.       -e 's; ./tm.h; tm.h config.status;g'  \
  447.       >depend
  448.     rm depend.tmp
  449.  
  450. config.status:
  451.     @echo "You must configure gdb.  Look at the README file for details."
  452.     @false
  453.  
  454. # These are not generated by "make depend" because they only are there
  455. # for some machines.
  456. # But these rules don't do what we want; we want to hack the foo.o: tm.h
  457. # dependency to do the right thing.
  458. tm-isi.h tm-sun3.h tm-news.h tm-hp300bsd.h tm-altos.h: tm-68k.h
  459. tm-hp300hpux.h tm-sun2.h tm-3b1.h: tm-68k.h
  460. xm-news1000.h: xm-news.h
  461. xm-i386-sv32.h: xm-i386.h
  462. tm-i386gas.h: tm-i386.h
  463. xm-sun4os4.h: xm-sparc.h
  464. tm-sun4os4.h: tm-sparc.h
  465. xm-vaxult.h: xm-vax.h
  466. xm-vaxbsd.h: xm-vax.h
  467.  
  468. kdb: $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${CDEPS}
  469.     rm -f init.c
  470.     $(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(NTSOBS) > init.c
  471.     $(CC) $(LDFLAGS) -c init.c $(CLIBS) 
  472.     ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o $(ADD_FILES) \
  473.       -lc $(CLIBS)
  474.  
  475. # Put the proper machine-specific files first.
  476. # createtags will edit the .o in DEPFILES into .c
  477. TAGS: ${TAGFILES}
  478.     $(srcdir)/createtags $(TM_FILE) ${XM_FILE} $(DEPFILES) ${TAGFILES}
  479. tags: TAGS
  480.  
  481. # Making distributions of GDB and friends.
  482.  
  483. # Make a directory `proto-gdb.dir' that contains an image of the GDB
  484. # directory of the distribution, built up with symlinks.
  485. make-proto-gdb.dir: force_update 
  486.     $(MAKE) $(MFLAGS) -f Makefile.in setup-to-dist
  487.     $(MAKE) $(MFLAGS) -f Makefile    make-proto-gdb-1
  488.  
  489. # Make a tar file containing the GDB directory of the distribution.
  490. gdb.tar.Z: force_update
  491.     $(MAKE) $(MFLAGS) -f Makefile.in setup-to-dist
  492.     $(MAKE) $(MFLAGS) -f Makefile.in gdb-$(VERSION).tar.Z
  493.  
  494. # Set up the GDB directory for distribution, by building all files that
  495. # are products of other files.
  496. setup-to-dist: force_update
  497.     ../configure none
  498.     rm -f alldeps.mak
  499.     $(MAKE) $(MFLAGS) alldeps.mak
  500.     ../configure none
  501.     rm -f depend
  502.     $(MAKE) $(MFLAGS) depend
  503.     ../configure none
  504.     (cd doc; $(MAKE) $(MFLAGS) gdbVN.m4)
  505.     $(MAKE) $(MFLAGS) gdb.info
  506.     $(MAKE) $(MFLAGS) refcard.ps
  507.  
  508. # Build a tar file from a proto-gdb.dir.
  509. gdb-$(VERSION).tar.Z: force_update
  510.     rm -f gdb.tar gdb-$(VERSION).tar.Z
  511.     $(MAKE) $(MFLAGS) -f Makefile    make-proto-gdb-1
  512.     ln -s proto-gdb.dir $(DIST)
  513.     tar chf - $(DIST) | compress >gdb-$(VERSION).tar.Z
  514.     rm -rf $(DIST) proto-gdb.dir
  515.  
  516. # Build a proto-gdb.dir after GDB has been set up for distribution.
  517. # This stuff must be run in `Makefile', not `Makefile.in`; we use the makefile
  518. # built in the setup-to-dist process, since it defines things like ALLCONFIG
  519. # and ALLDEPFILES, that we need.
  520. make-proto-gdb-1: ${TARFILES} ${TARDIRS} gdb.info
  521.     rm -rf proto-gdb.dir
  522.     mkdir proto-gdb.dir
  523.     cd proto-gdb.dir ; for i in ${TARFILES} ; do ln -s ../$$i . ; done
  524.     cd proto-gdb.dir ; ln -s ../${INFOFILES} .
  525.     cd proto-gdb.dir ; for i in ${TARDIRS}; do \
  526.       (mkdir $$i; cd $$i; \
  527.       ln -s ../../$$i/* .; \
  528.       rm -rf SCCS CVS.adm RCS config.status); done
  529.     mkdir proto-gdb.dir/config
  530.     cd proto-gdb.dir/config ; \
  531.       for i in $(ALLCONFIG) ; do ln -s ../../$$i ../$$i ; done
  532.     mkdir proto-gdb.dir/vx-share proto-gdb.dir/nindy-share
  533.     cd proto-gdb.dir/config ; \
  534.       for i in $(SFILES_SUBDIR) $(NONSRC_SUBDIR) $(ALLDEPFILES_SUBDIR); \
  535.         do ln -s ../../$$i ../$$i ; done
  536.     chmod og=u `find . -print`
  537.  
  538. clean:
  539.     rm -f *.o ${ADD_FILES}
  540.     rm -f init.c version.c
  541.     rm -f gdb core gdb.tar gdb.tar.Z make.log
  542.     rm -f gdb[0-9]
  543.     $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS)"
  544.  
  545. distclean: clean c-exp.tab.c m2-exp.tab.c TAGS
  546.     rm -f tm.h xm.h config.status
  547.     rm -f y.output yacc.acts yacc.tmp
  548.     rm -f ${TESTS} Makefile depend
  549.     $(MAKE) subdir_do DO=distclean "DODIRS=$(SUBDIRS)"
  550.  
  551. realclean: clean
  552.     rm -f c-exp.tab.c m2-exp.tab.c TAGS
  553.     rm -f tm.h xm.h config.status
  554.     rm -f Makefile depend
  555.     $(MAKE) subdir_do DO=realclean "DODIRS=$(SUBDIRS)"
  556.  
  557. STAGESTUFF=${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} init.c init.o version.c gdb
  558.  
  559. subdir_do: force
  560.     for i in $(DODIRS); do \
  561.         if [ -d ./$$i ] ; then \
  562.             if (cd ./$$i; \
  563.                 $(MAKE) \
  564.                     "against=$(against)" \
  565.                     "AR=$(AR)" \
  566.                     "AR_FLAGS=$(AR_FLAGS)" \
  567.                     "CC=$(CC)" \
  568.                     "RANLIB=$(RANLIB)" \
  569.                     "MAKEINFO=$(MAKEINFO)" \
  570.                     "BISON=$(BISON)" $(DO)) ; then true ; \
  571.             else exit 1 ; fi ; \
  572.         else true ; fi ; \
  573.     done
  574.  
  575. # Copy the object files from a particular stage into a subdirectory.
  576. stage1: force
  577.     -mkdir stage1
  578.     -mv -f $(STAGESTUFF) stage1
  579.     $(MAKE) subdir_do DO=stage1 "DODIRS=$(SUBDIRS)"
  580.  
  581. stage2: force
  582.     -mkdir stage2
  583.     -mv -f $(STAGESTUFF) stage2
  584.     $(MAKE) subdir_do DO=stage2 "DODIRS=$(SUBDIRS)"
  585.  
  586. stage3: force
  587.     -mkdir stage3
  588.     -mv -f $(STAGESTUFF) stage3
  589.     $(MAKE) subdir_do DO=stage3 "DODIRS=$(SUBDIRS)"
  590.  
  591. against=stage2
  592.  
  593. comparison: force
  594.     for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
  595.     $(MAKE) subdir_do DO=comparison "DODIRS=$(SUBDIRS)"
  596.  
  597. de-stage1: force
  598.     -(cd stage1 ; mv -f * ..)
  599.     -rmdir stage1
  600.     $(MAKE) subdir_do DO=de-stage1 "DODIRS=$(SUBDIRS)"
  601.  
  602. de-stage2: force
  603.     -(cd stage2 ; mv -f * ..)
  604.     -rmdir stage2
  605.     $(MAKE) subdir_do DO=de-stage2 "DODIRS=$(SUBDIRS)"
  606.  
  607. de-stage3: force
  608.     -(cd stage3 ; mv -f * ..)
  609.     -rmdir stage3
  610.     $(MAKE) subdir_do DO=de-stage3 "DODIRS=$(SUBDIRS)"
  611.  
  612. Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
  613.     $(SHELL) ./config.status
  614.  
  615. force:
  616.  
  617. # Documentation!
  618. # GDB QUICK REFERENCE (TeX dvi file, CM fonts)
  619. refcard.dvi: $(srcdir)/doc/refcard.tex
  620.     ( cd ./doc; $(MAKE) refcard.dvi )
  621.     mv ./doc/refcard.dvi .
  622.  
  623. # GDB QUICK REFERENCE (PostScript output, common PS fonts)
  624. refcard.ps: $(srcdir)/doc/refcard.tex
  625.     ( cd ./doc; $(MAKE) refcard.ps )
  626.     mv ./doc/refcard.ps .
  627.  
  628. # GDB MANUAL: TeX dvi file
  629. gdb.dvi: ./doc/gdb-all.texi
  630.     ( cd ./doc; $(MAKE) M4=$(M4) gdb.dvi )
  631.     mv ./doc/gdb.dvi .
  632.  
  633. # GDB MANUAL: info file
  634. gdb.info: ./doc/gdb-all.texi
  635.     ( cd ./doc; $(MAKE) M4=$(M4) gdb.info )
  636.     mv ./doc/gdb.info* .
  637.  
  638. ./doc/gdb-all.texi:
  639.     (cd $(srcdir)/doc; $(MAKE) M4=$(M4) gdb-all.texi)
  640.  
  641. # Make copying.c from COPYING
  642. copying.c: ${srcdir}/COPYING ${srcdir}/copying.awk
  643.     awk -f ${srcdir}/copying.awk < ${srcdir}/COPYING > copying.c
  644.  
  645. version.c: Makefile.in
  646.     echo 'char *version = "$(VERSION)";' >version.c
  647.  
  648. # c-exp.tab.c is generated in target dir from c-exp.y if it doesn't exist
  649. # in srcdir, then compiled in target dir to c-exp.tab.o.
  650. c-exp.tab.o: c-exp.tab.c
  651. c-exp.tab.c: $(srcdir)/c-exp.y
  652.     @echo 'Expect 4 shift/reduce conflicts.'
  653.     ${YACC} $(srcdir)/c-exp.y
  654.     -mv y.tab.c c-exp.tab.c
  655.  
  656. # m2-exp.tab.c is generated in target dir from m2-exp.y if it doesn't exist
  657. # in srcdir, then compiled in target dir to m2-exp.tab.o.
  658. m2-exp.tab.o: m2-exp.tab.c
  659. m2-exp.tab.c: $(srcdir)/m2-exp.y
  660.     ${YACC} $(srcdir)/m2-exp.y
  661.     -mv y.tab.c m2-exp.tab.c
  662.  
  663. # The symbol-file readers have dependencies on BFD header files.
  664. dbxread.o: ${srcdir}/dbxread.c
  665.     ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/dbxread.c
  666.  
  667. coffread.o: ${srcdir}/coffread.c
  668.     ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/coffread.c
  669.  
  670. mipsread.o: ${srcdir}/mipsread.c
  671.     ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/mipsread.c
  672.  
  673. elfread.o: ${srcdir}/elfread.c
  674.     ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/elfread.c
  675.  
  676. dwarfread.o: ${srcdir}/dwarfread.c
  677.     ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/dwarfread.c
  678.  
  679. xcoffread.o: ${srcdir}/xcoffread.c
  680.     ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/xcoffread.c
  681.  
  682. xcoffexec.o: ${srcdir}/xcoffexec.c
  683.     ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/xcoffexec.c
  684.  
  685. # Drag in the files that are in another directory.
  686.  
  687. xdr_ld.o: ${srcdir}/vx-share/xdr_ld.c
  688.     ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_ld.c
  689.  
  690. xdr_ptrace.o: ${srcdir}/vx-share/xdr_ptrace.c
  691.     ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_ptrace.c
  692.  
  693. xdr_rdb.o: ${srcdir}/vx-share/xdr_rdb.c
  694.     ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_rdb.c
  695.  
  696. xdr_regs.o: ${srcdir}/vx-share/xdr_regs.c
  697.     ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_regs.c
  698.  
  699. nindy.o: ${srcdir}/nindy-share/nindy.c
  700.     ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/nindy.c
  701.  
  702. Onindy.o: ${srcdir}/nindy-share/Onindy.c
  703.     ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/Onindy.c
  704.  
  705. ttybreak.o: ${srcdir}/nindy-share/ttybreak.c
  706.     ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/ttybreak.c
  707.  
  708. ttyflush.o: ${srcdir}/nindy-share/ttyflush.c
  709.     ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/ttyflush.c
  710.  
  711. lint: $(LINTFILES)
  712.     $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \
  713.        `echo ${DEPFILES} | sed 's/\.o /\.c /g'
  714.  
  715. gdb.cxref: $(SFILES)
  716.     cxref -I. $(SFILES) >gdb.cxref
  717.  
  718. force_update:
  719.  
  720. # When used with GDB, the demangler should never look for leading
  721. # underscores because GDB strips them off during symbol read-in.  Thus
  722. # -Dnounderscore.  
  723.  
  724. cplus-dem.o: cplus-dem.c
  725.     ${CC} -c ${CFLAGS} -Dnounderscore \
  726.       `echo ${srcdir}/cplus-dem.c | sed 's,^\./,,'`
  727.  
  728. # GNU Make has an annoying habit of putting *all* the Makefile variables
  729. # into the environment, unless you include this target as a circumvention.
  730. # Rumor is that this will be fixed (and this target can be removed)
  731. # in GNU Make 4.0.
  732. .NOEXPORT:
  733.  
  734. # This is the end of "Makefile.in".  When built into "Makefile"
  735. # by the configure script, two things are added below this point:
  736. #     alldeps.mak -- defintions of all files that are used in
  737. #            host- or target-dependent configurations
  738. #    depend -- what .o files depend on what .c and .h files,
  739. #            for all configurations.
  740.  
  741.  
  742.